<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>呼叫云</title>
    <link rel="shortcut icon" href="../img/logox_circle.png">
    <link rel="stylesheet" href="../css/pintuer.css">
    <link rel="stylesheet" href="../css/admin.css">
    <script src="../js/jquery-1.11.0.min.js"></script> 
    <script src="../js/config.js"></script>
    <script src="../js/fenye.js"></script> 
    <script src="../common/laydate/laydate.js"></script> 
	<script>
		$(function(){
			$("#showName").val("money3");
			//总条数
			var counts = ${count};
			//总页数
			var pageCouts = "";
			if(counts % 10 == 0){
				pageCouts =  parseInt(counts/10);
			}else{
				pageCouts =  parseInt(counts/10) + 1;
			}
			pg = new showPages('pg','${page}',pageCouts,counts);
			
			pg.printHtml(2,pageCouts);        //显示页数
			
			showPages.prototype.createUrl = function (page) { //生成页面跳转url
				if (isNaN(parseInt(page))) page = 1;
				if (page < 1) page = 1;
				if (page > this.pageCount) page = this.pageCount;
				var url = location.protocol + '//' + location.host + location.pathname +"?page="+page;
				
				//获取参数
				var loginName = $("#loginName").val();
				if(loginName != ""){
					url = url+"&loginName="+loginName;
				}
				var entName = $("#entName").val();
				if(entName != ""){
					url = url+"&entName="+entName;
				}
				var name = $("#name").val();
				if(name != ""){
					url = url+"&name="+name;
				}
				var startTime = $("#startTime").val();
				var enTime = $("#enTime").val();
				if(startTime != "" && enTime != ""){
					url = url+"&startTime="+startTime+"&enTime="+enTime;
				}
				
				return url;
			}
		});
		//搜索
		function search(){
			var startTime = $("#startTime").val();
			var enTime = $("#enTime").val();
			if(startTime != ""){
				if(enTime == ""){
					alert("截止日期不能为空！");
				}else{
					$("#getUserRechargeList").submit();
				}
			}else{
				$("#getUserRechargeList").submit();
			}
		}
	</script>
</head>

<body>
<div class="lefter">
    <div class="logo"><a href="#" target="_blank"><img style="width:100%;" src="../img/logo3.png" alt="呼叫云后台管理系统" /></a></div>
</div>
<div class="righter nav-navicon" id="admin-nav">
    <div class="mainer">
        <div class="admin-navbar">
            <span class="float-right">
            	<span id="user_name"></span>
                <a class="button button-little bg-yellow" href="login">注销登录</a>
            </span>
            <#include "../common/head.ftl"> 
        </div>
        <div class="admin-bread">
            <ul class="bread">
                <li><a class="icon-money"> 支付管理</a></li>
                <li><a >用户充值</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="admin">
    <div class="line-big">
		<div class="xm12">
			<form action="getUserRechargeList" id="getUserRechargeList" method="get">
			<div style="float:left;padding-top:5px;"><strong>用户名：</strong></div>
			<div style="float:left;">
				<input type="text" class="input" style="width:80%;" id="loginName" name="loginName" value="${loginName}">
			</div>
			<div style="float:left;padding-top:5px;"><strong>企业名称：</strong></div>
			<div style="float:left;">
				<input type="text" class="input" style="width:80%;" id="entName" name="entName" value="${entName}">
			</div>
			<div style="float:left;padding-top:5px;"><strong>姓名：</strong></div>
			<div style="float:left;">
				<input type="text" class="input" style="width:80%;" id="name" name="name" value="${name}">
			</div>
			<div style="float:left;padding-top:5px;"><strong>充值日期：</strong></div>
			<div style="float:left;">
				<input onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})" placeholder="开始日期" style="width:95%;" class="input" id="startTime" name="startTime" value="${startTime}">
			</div>
			<div style="float:left;padding-top:5px;">
				<strong>-&nbsp;</strong>
			</div>
			<div style="float:left;padding-left:5px;">
				<input onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm'})" placeholder="截止日期" style="width:95%;" class="input" id="enTime" name="enTime" value="${enTime}">
			</div>
			</form>
			<div style="float:left;padding-left:20px;">
				<button class="button bg-main" type="submit" onclick="search()">搜索</button>
			</div>
			<div style="float:left;padding-left:20px;">
				<a class="button bg-main" href="#modal" id="recharge">充值</a>
			</div>
		</div>
	</div>
    <div class="panel admin-panel" style="margin-top:20px;">
		
    	<div class="panel-head"><strong>用户充值列表</strong></div>
        
        <table class="table table-hover">
        	<tr>
				<th width="40">序号</th>
				<th width="100">用户名</th>
				<th width="150">企业名称</th>
				<th width="80">姓名</th>
				<th width="100">手机号</th>
				<th width="80">充值金额</th>
				<th width="80">充值渠道</th>
				<th width="80">充值状态</th>
				<th width="150">充值时间</th>
				<th width="150">创建时间</th>
				<th width="150">操作</th>
			</tr>
			<#list userRechargeList as payRecordMap>
				<#if count gt 0 >
				<tr>
					<td>${payRecordMap_index+1}</td>
					    <td>${payRecordMap.loginName}</td>
					    <td>${payRecordMap.entName}</td>
					    <td>${payRecordMap.name}</td>
						<td>${payRecordMap.phone}</td>
						<td>${payRecordMap.amount}</td>
						<td>${payRecordMap.payChannel}</td>
						<td>
							<#if payRecordMap.payStatus==0 >
								正在处理
							<#elseif payRecordMap.payStatus==1 >
								支付成功
							<#elseif payRecordMap.payStatus==2 >
								支付失败
							<#else>
								
							</#if>
						</td>
						<td>${payRecordMap.payTime}</td>
						<td>${payRecordMap.createTime}</td>
						<td>
							<a class="button border-blue button-little" href="getPayRecord?payRecordID=${payRecordMap.payRecordID}">查看</a>
						</td>
				</tr>
				</#if>
			</#list>
			
        </table>
        <div class="panel-foot text-center">
				<#if count gt 0 >
		            <!--<ul class="pagination"><li><a href="#">上一页</a></li></ul>
		            <ul class="pagination pagination-group">
		                <li class="active"><a href="#">1</a></li>
		                <li><a href="#">2</a></li>
		                <li><a href="#">3</a></li>
		                <li><a href="#">4</a></li>
		                <li><a href="#">5</a></li>
		            </ul>
		            <ul class="pagination"><li><a href="#">下一页</a></li></ul>-->
		            
		            
		             <div class="page" id="pages"></div>
		            
		            
		        <#else>
		       <div style="padding-top:30px;"><strong>没有相关数据</strong></div>
				</#if>
        </div>
    </div>
    <br />
</div>
<div id="modal" class="admin" style="display:none;width:70%;height:70%;border-radius:10px 10px 10px 10px;padding:20px;">
	<#include "userPayRecord.ftl"> 
</div>
</body>
</html>